/**
 * @Description: WoShop商城
 * @Author: Parker
 * @Copyright: 武汉一一零七科技有限公司©版权所有
 * @Link: www.s1107.com
 * @Contact: QQ:2487937004
 */
import Vue from "vue";
import App from "./App";
import api from "./api";
import * as  utils from "./utils";
import store from "./store";
import mpvuePicker from "./components/mpvue-picker/mpvuePicker.vue";
import uView from "uview-ui";
import loadMore from "./components/uni-load-more.vue";
import popupLayer from "./components/popup-layer.vue";
import dropdown from './components/dt-dropdown/dt-dropdown.vue'

import liveAnimation from "./components/liveAnimation";
import {APPNAME, STATICURL} from "./config/index.js";
import im from "./utils/socket"
// import * as Sentry from "@sentry/vue";
// import { Integrations } from "@sentry/tracing";
// Sentry.init({
//   Vue,
//   dsn: "https://8ccf25eb00284360a2dfa22150e227a0@o540581.ingest.sentry.io/5658967",
//   integrations: [new Integrations.BrowserTracing()],
//
//   tracesSampleRate: 1.0,
// });

// #ifdef  H5
// import VConsole from 'vconsole'; // 手机端真机调试chrome面板
//
// if(process.env.NODE_ENV === "development"){
//   new VConsole();
// }
// #endif
Vue.prototype.$store = store;
Vue.config.productionTip = false;
Vue.use(uView);

Vue.component("mpvue-picker", mpvuePicker);
Vue.component("popup-layer", popupLayer);
Vue.component("liveAnimation", liveAnimation);
Vue.component('dropdown', dropdown)
Vue.component("loadMore", loadMore);

Vue.prototype.$navigateTo = utils.navigateTo;

App.mpType = "app";


// 返回上级页面
Vue.prototype.getback = function() {
  uni.navigateBack({
    delta: 1,
  });
};

Vue.prototype.getnav = function(url) {
  uni.navigateTo({
    url: url,
  });
};

Vue.prototype.statusMath = function(that) {
  setTimeout(() => {
    that.valueStatus = Math.random();
  }, 100);
};

Vue.filter('defaultValue', value=> {
    if(!value) return 0;
  return value
})

Vue.filter('tagType',value=>{
  const list  = ['自营','秒杀','团购','拼团']
  return list[+value]
})

Vue.filter('currency',value=>{
  return ''
})

Vue.prototype.im = im;  //绑定全局的socket链接事件  分别在登录时和 APP Luanch时触发
Vue.prototype.$showModal = utils.showModal;
Vue.prototype.$http = api;
Vue.prototype.$Dialog = utils.Dialog;
Vue.prototype.$loading = utils.showLoading;
Vue.prototype.$hideLoading = utils.hideLoading;
Vue.prototype.$toast = utils.showToast;
Vue.prototype.$formatDateTime = utils.formatDateTime;
Vue.prototype.$formatSeconds = utils.formatSeconds;
Vue.prototype.$copy = utils.copy;
Vue.prototype.$AppName = APPNAME;
//
// Vue.config.errorHandler = function(err,vm,info){
//   console.log(err)
// }


const baseUrl = uni.getStorageSync('baseUrl')
Vue.prototype.$baseUrl = baseUrl;
Vue.prototype.$imgGoodsNullUrl ="https://www-uqu-ltd-1304523031.cos.ap-nanjing.myqcloud.com/static/images/img/cartinfo.png";
// 存放在腾讯云COS存储上的前端静态资源文件地址
Vue.prototype.STATICURL=STATICURL;

const app = new Vue({
  store,
  ...App,
});
// console.log(*)

app.$mount();

// 判断地理位置是否授权
